package com.xb.cloud.order.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xb.cloud.order.model.SoSkuExample;
import com.xb.cloud.order.model.SoSkuExample.Criteria;
import com.xb.cloud.order.model.mapper.SoSkuMapper;
import com.xb.cloud.order.service.client.SellOrderSkuService;
import com.xb.cloud.order.service.client.bo.SoSkuSummeryBo;

@Service
public class SellOrderSkuServiceImpl extends AbstractService implements SellOrderSkuService {

	@Resource
	SoSkuMapper mapper;

	@Override
	public List<SoSkuSummeryBo> getOrderSkuListByOrderIdList(List<Long> orderIds) {
		if (orderIds == null || orderIds.size() == 0) {
			return null;
		}
		SoSkuExample example = new SoSkuExample();
		example.createCriteria().andSoIdIn(orderIds);
		return mapper.getOrderSkuListByOrderIdList(example);
	}

	@Override
	public List<SoSkuSummeryBo> getOrderSkuListByOrderId(Long soId) {
		SoSkuExample example = new SoSkuExample();
		example.createCriteria().andSoIdEqualTo(soId);
		return mapper.getOrderSkuListByOrderId(example);
	}

}
